<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <title>Document</title>
    </head>
    <body>
        <script>
            //赋值运算符 = += -= *= /= %= ++ --
            //赋值运算也产生值，等号后面的值将作为【赋值运算的值】意味着可以连等
            var a
            console.log(a=4);//4  给a赋值了，输出为4
            //快捷赋值 += -= *= /= %=
            //自增 自减 ++ --
            //a++ 先用再加 ++a先加再用
            var a=3;
            var b=a++;
            console.log(b);//3  先用
            console.log(a);//4  再加
            var a=3;
            var b=++a;
            console.log(a);//4  先加
            console.log(b);//4  再用


            var a=3;
            var b=4;
            alert(a++ + b++ + ++a + ++b)//3+4+5+6=18    3+4+(3+1+1)+(4+1+1)
        </script>
    </body>
    </html>
</body>
</html>